SYS := $(shell gcc -dumpmachine)

SRC=test.cpp osdependent_func.cpp
CXXFLAGS= -D__STDC_CONSTANT_MACROS


ifneq (, $(findstring linux, $(SYS)))
LDFLAGS= -ldl
STATIC_BUILD = ./libOverlay.so
endif


ifneq (, $(findstring cygwin, $(SYS)))
SRC += dlfunc.c
CXX=x86_64-w64-mingw32-g++
CXXFLAGS += -DWINDOWS -static-libgcc -static-libstdc++ -I/usr/local/include/
STATIC_BUILD = ./libOverlay.dll
endif


all:test.cpp
	$(CXX) -g $(SRC)   $(CXXFLAGS) $(LDFLAGS)

debug:$(SRC)
	$(CXX) -g $(SRC)  $(CXXFLAGS) $(STATIC_BUILD)  -DCHECK_MEMORY_LEAK -lefence


clean:
	rm -rf a.out test.ts
